package dao

import "gin-system/models"

func GetStudent(physicalParam map[string]interface{}) (error, []models.Physical, int64) {
	var physicalData []models.Physical
	page := physicalParam["page"].(int)
	pageSize := physicalParam["limit"].(int)
	searchName := physicalParam["studentName"].(string)
	var total int64
	err := db.Table("physical").Select("id, student_id, student_name, sex,age,height, weight,chest,creat_time, update_time").Where("student_name like ?", searchName+"%").Order("id ASC").Count(&total).Offset((page - 1) * pageSize).Limit(pageSize).Find(&physicalData).Error
	return err, physicalData, total
}
